
cmake_minimum_required(VERSION 3.10.2)

find_library(log-lib log)
find_library(android-lib android)
#引入头文件
include_directories(include)
#soundtouch头文件两个路径
include_directories(soundtouch/include)
#这个路径里也有头文件
include_directories(soundtouch/SoundTouch)

#添加到系统变量
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}")

#set(ffmpeg_lib_dir ${CMAKE_CURRENT_SOURCE_DIR}/libs/${ANDROID_ABI})

aux_source_directory(. SOURCE)

aux_source_directory(./soundtouch/SoundTouch SOUNDTOUCH)

add_library(
        native-lib
        SHARED
        ${SOURCE}
        ${SOUNDTOUCH}
)

#add_library( avutil
#        SHARED
#        IMPORTED )
#
#set_target_properties( avutil
#        PROPERTIES IMPORTED_LOCATION
#        ${ffmpeg_lib_dir}/libavutil.so )
#
#add_library( swresample
#        SHARED
#        IMPORTED )
#set_target_properties( swresample
#        PROPERTIES IMPORTED_LOCATION
#        ${ffmpeg_lib_dir}/libswresample.so )
#
#add_library( avcodec
#        SHARED
#        IMPORTED )
#set_target_properties( avcodec
#        PROPERTIES IMPORTED_LOCATION
#        ${ffmpeg_lib_dir}/libavcodec.so )
#
#add_library( avfilter
#        SHARED
#        IMPORTED)
#set_target_properties( avfilter
#        PROPERTIES IMPORTED_LOCATION
#        ${ffmpeg_lib_dir}/libavfilter.so )
#
#add_library( swscale
#        SHARED
#        IMPORTED)
#set_target_properties( swscale
#        PROPERTIES IMPORTED_LOCATION
#        ${ffmpeg_lib_dir}/libswscale.so )
#
#add_library( avformat
#        SHARED
#        IMPORTED)
#set_target_properties( avformat
#        PROPERTIES IMPORTED_LOCATION
#        ${ffmpeg_lib_dir}/libavformat.so )

target_link_libraries(
        native-lib
        avcodec
        avfilter
        swscale
        avformat
        avutil
        swresample
        android
        OpenSLES
        ${log-lib}
)
